package tr.mesir.domain;

import java.io.Serializable;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import org.hibernate.search.annotations.DocumentId;

/**
 * With @MappedSuperClass mapping information is applied to the entities that inherit from the BaseObject. 
 * And BaseObject has no separate table defined for it inside the DB. 
 * 
 * @author mertcaliskan
 */
@MappedSuperclass
public abstract class BaseObject implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8556437027740227314L;
	/*
	 * @DocumentId is the untokenized id stored by hibernate search that ensures index unicity for a given entity.
	 */
	@Id
	@DocumentId
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
}